package main;
import java.awt.Color;

/**
 * Implements cities (to spawn units from)
 * @author 12817152
 *
 */
public class City {
	Color col = new Color(143, 143, 143); //lt gray 
	Color origCol = col;
	private int x;
	private int y;
	Player owner;
	
	/**
	 * places city at x, y coord
	 * @param xpos
	 * @param ypos
	 */
	public City(int xpos, int ypos){
		x=xpos;
		y=ypos;
	}
	
	/**
	 * assigns owner
	 * @param o - player that is owner
	 */
	public void assignOwner(Player o) {
		owner = o;
	}
	
	/**
	 * returns location in integer array
	 * @return x,y location
	 */
	public int[] getLocation(){
		int[] location= {x,y};
		return location;
	}
	
	/**
	 * returns current color
	 * @return color
	 */
	public Color getColor() {
		return col;
	}
	
	/**
	 * returns base color
	 * @return base color
	 */
	public Color getOrigCol() {
		return origCol;
	}
	
	/**
	 * sets color
	 * @param c - color
	 */
	public void setCol(Color c) {
		col = c;
	}
	
	/**
	 * places in land, given map
	 * @param bm - map
	 */
	public void placeInLand(BasicMap bm) {
		bm.getLand(x,y).addCity(this);
	}
}
